import Toast from 'react-native-simple-toast';


import {Platform,ToastAndroid} from  'react-native';

//toast吐司提醒
export function  ToastToUser(message){
    if(Platform.OS =='ios'){
        Toast.showWithGravity(
            message,
            Toast.SHORT,
            Toast.CENTER,
          );
    }else{
        ToastAndroid.showWithGravity(message, ToastAndroid.SHORT, ToastAndroid.CENTER);
    }
}

export function  ToastToUserOnPosition(message, position){
    if(Platform.OS =='ios'){
        Toast.show(message,{
            duration: Toast.durations.SHORT,
            position: position ? position:(Constant.screen_height / 2)
        });
    }else{
        ToastAndroid.showWithGravity(message, ToastAndroid.SHORT, ToastAndroid.CENTER);
    }
}